Lens Controller
|
This class provides the LensControllerAPI, a class for interfacing with the VA Imaging lens controller over a serial port. More...
Public Member Functions | |
__init__ (self, port) | |
initializes the LensControllerAPI class. | |
connect (self) | |
Opens the serial connection to the lens controller. | |
disconnect (self) | |
Closes the serial connection to the lens controller. | |
send_command (self, command) | |
Sends a command to the lens controller and reads the response. | |
send_custom_command_and_receive (self, command1, data1=0x01, data2=0x02, data3=0x03, data4=0x04) | |
Sends a custom command to the lens controller and reads the response. | |
pelco_d_zoom_in (self) | |
Send Pelco D Command - Zoom in. | |
pelco_d_zoom_out (self) | |
Send Pelco D Command - Zoom out. | |
pelco_d_focus_far (self) | |
Send Pelco D Command - Focus far. | |
pelco_d_focus_near (self) | |
Send Pelco D Command - Focus near. | |
pelco_d_iris_open (self) | |
Send Pelco D Command - Iris open. | |
pelco_d_iris_close (self) | |
Send Pelco D Command - Iris close. | |
pelco_d_stop_all (self) | |
Send Pelco D Command - Stop all focus, iris and zoom actions. | |
pelco_d_call_preset (self, preset) | |
Send Pelco D Command - Call preset. | |
pelco_d_set_preset (self, preset) | |
Send Pelco D Command - Set preset; Set current positions under preset# @Note: The preset is set, but will be lost after power cycle. | |
pelco_d_set_zoom_speed (self, speed) | |
Send Pelco D Command - Set zoom speed; Set speed for zooming in and out @Note: Call custom_store_current_settings() to store the set speed in the lens controller. | |
pelco_d_set_focus_speed (self, speed) | |
Send Pelco D Command - Set focus speed; Set speed for focussing far and near @Note: Call custom_store_current_settings() to store the set speed in the lens controller. | |
custom_calibrate_all (self) | |
Send Custom Command - Calibrate the lens controller. | |
custom_select_lens_default_afz (self) | |
Send Custom Command - Select lens type: VA Imaging AFZ Lens. | |
custom_select_lens_AFZ2 (self) | |
Send Custom Command - Select lens type: VA Imaging AFZ2 Lens. | |
custom_get_zoom_position (self) | |
Send Custom Command - Get zoom position This function retrieves the current zoom position of the lens. | |
custom_set_zoom_position (self, zoom_position) | |
Send Custom Command - Set zoom position of the lens. | |
custom_get_focus_position (self) | |
Send Custom Command - Get focus position This function retrieves the current focus position of the lens. | |
custom_set_focus_position (self, focus_position) | |
Send Custom Command - Set focus position of the lens. | |
custom_get_iris_position (self) | |
Send Custom Command - Get iris position This function retrieves the current focus position of the lens. | |
custom_set_iris_position (self, iris_position) | |
Send Custom Command - Set iris position of the lens. | |
custom_get_lens_type (self) | |
Send Custom Command - Get lens type This function retrieves the selected lens type. | |
custom_store_current_settings (self) | |
Send Custom Command - store current settings in lens controller This function stores all settings in the lens controller. | |
custom_disable_stall_detection (self) | |
Send Custom Command - Disable stall detection for all motors This function disables stall detection for all motors. | |
custom_get_sensitivity_mode (self) | |
Send Custom Command - Get sensitivity type This function retrieves the sensitivity mode. | |
custom_set_sensitivity_mode (self, mode) | |
Send Custom Command - Set sensitivity of the lens. | |
Public Attributes | |
port | |
connection | |
Static Public Attributes | |
logger = logging.getLogger('logger') | |
Protected Member Functions | |
_build_pelco_d_command (self, command1, command2, data1=0x00, data2=0x00) | |
_build_custom_command (self, command1, data1=0x00, data2=0x00, data3=0x00, data4=0x00) | |
This class provides the LensControllerAPI, a class for interfacing with the VA Imaging lens controller over a serial port.
The LensControllerAPI uses the Pelco-D and custom commands to control lens actions such as zooming, focusing, iris control, etc.
api.LensControllerAFZ.__init__ | ( | self, | |
port | |||
) |
initializes the LensControllerAPI class.
[in] | port | The port to use for the serial connection. |
api.LensControllerAFZ.custom_calibrate_all | ( | self | ) |
Send Custom Command - Calibrate the lens controller.
This is automatically done on power on. @Note: The calibration process is not te be interrupted by other commands.
api.LensControllerAFZ.custom_disable_stall_detection | ( | self | ) |
Send Custom Command - Disable stall detection for all motors This function disables stall detection for all motors.
It serves as a solution in case motors have more resistance than expected.
api.LensControllerAFZ.custom_get_focus_position | ( | self | ) |
Send Custom Command - Get focus position This function retrieves the current focus position of the lens.
api.LensControllerAFZ.custom_get_iris_position | ( | self | ) |
Send Custom Command - Get iris position This function retrieves the current focus position of the lens.
api.LensControllerAFZ.custom_get_lens_type | ( | self | ) |
Send Custom Command - Get lens type This function retrieves the selected lens type.
api.LensControllerAFZ.custom_get_sensitivity_mode | ( | self | ) |
Send Custom Command - Get sensitivity type This function retrieves the sensitivity mode.
api.LensControllerAFZ.custom_get_zoom_position | ( | self | ) |
Send Custom Command - Get zoom position This function retrieves the current zoom position of the lens.
api.LensControllerAFZ.custom_set_focus_position | ( | self, | |
focus_position | |||
) |
Send Custom Command - Set focus position of the lens.
[in] | focus_position | The absolute position of the focus lens |
api.LensControllerAFZ.custom_set_iris_position | ( | self, | |
iris_position | |||
) |
Send Custom Command - Set iris position of the lens.
[in] | iris_position | The absolute position of the iris lens |
api.LensControllerAFZ.custom_set_sensitivity_mode | ( | self, | |
mode | |||
) |
Send Custom Command - Set sensitivity of the lens.
[in] | sensitivity | mode as an integer:
|
api.LensControllerAFZ.custom_set_zoom_position | ( | self, | |
zoom_position | |||
) |
Send Custom Command - Set zoom position of the lens.
[in] | zoom_position | The absolute position of the zoom lens |
api.LensControllerAFZ.custom_store_current_settings | ( | self | ) |
Send Custom Command - store current settings in lens controller This function stores all settings in the lens controller.
Settings will be restored after power cycle.
api.LensControllerAFZ.pelco_d_call_preset | ( | self, | |
preset | |||
) |
Send Pelco D Command - Call preset.
[in] | preset | The preset (number [1-10]) to call |
api.LensControllerAFZ.pelco_d_set_focus_speed | ( | self, | |
speed | |||
) |
Send Pelco D Command - Set focus speed; Set speed for focussing far and near @Note: Call custom_store_current_settings() to store the set speed in the lens controller.
[in] | speed | The speed value (number [0-2]) |
api.LensControllerAFZ.pelco_d_set_preset | ( | self, | |
preset | |||
) |
Send Pelco D Command - Set preset; Set current positions under preset# @Note: The preset is set, but will be lost after power cycle.
Call custom_store_current_settings() to store the preset in the lens controller.
[in] | preset | The preset (number [1-10]) to call |
api.LensControllerAFZ.pelco_d_set_zoom_speed | ( | self, | |
speed | |||
) |
Send Pelco D Command - Set zoom speed; Set speed for zooming in and out @Note: Call custom_store_current_settings() to store the set speed in the lens controller.
[in] | speed | The speed value (number [0-2]) |
api.LensControllerAFZ.send_command | ( | self, | |
command | |||
) |
Sends a command to the lens controller and reads the response.
[in] | command | The command to send. |
api.LensControllerAFZ.send_custom_command_and_receive | ( | self, | |
command1, | |||
data1 = 0x01 , |
|||
data2 = 0x02 , |
|||
data3 = 0x03 , |
|||
data4 = 0x04 |
|||
) |
Sends a custom command to the lens controller and reads the response.
[in] | command1 | The first command to send. |
[in] | data1 | The first piece of data to send. |
[in] | data2 | The second piece of data to send. |
[in] | data3 | The third piece of data to send. |
[in] | data4 | The fourth piece of data to send. |